import request from '@/utils/request'

// 查询工位自检基础列表
export function listInspection(query) {
  return request({
    url: '/mes/station/stationCheckTemplate/list',
    method: 'get',
    params: query
  })
}

// 查询工位自检基础详细
export function getInspection(id) {
  return request({
    url: '/mes/pro/self/inspection/' + id,
    method: 'get'
  })
}

// 新增工位自检基础1
export function addInspection(data) {
  return request({
    url: '/mes/station/stationCheckTemplate',
    method: 'post',
    data: data
  })
}

// 修改工位自检基础
export function updateInspection(data) {
  return request({
    url: '/mes/station/stationCheckTemplate',
    method: 'put',
    data: data
  })
}

// 删除工位自检基础
export function delInspection(id) {
  return request({
    url: '/mes/station/stationCheckTemplate/' + id,
    method: 'delete'
  })
}


// 获取工序编码、工序名称list
export function processList(query) {
  return request({
    url: '/mes/pro/process/list',
    method: 'get',
    params: query
  })
}



// 查询工位自检配置明细列表
export function listCheckConfDetail(id) {
  return request({
    url: '/mes/station/checkConfDetail/getStationCheckConfDetail/' + id,
    method: 'get',
    // params: query
  })
}

// 新增工位自检配置明细
export function addCheckConfDetail(data) {
  return request({
    url: '/mes/station/checkConfDetail',
    method: 'post',
    data: data
  })
}

// 修改工位自检配置明细
export function updateCheckConfDetail(data) {
  return request({
    url: '/mes/station/checkConfDetail',
    method: 'put',
    data: data
  })
}

// 删除工位自检配置明细
export function delCheckConfDetail(id) {
  return request({
    url: '/mes/station/checkConfDetail/' + id,
    method: 'delete'
  })
}
// 产品
// 所属产品列表
export function getProductInfoList(checkTemplateId) {
  return request({
    url: '/mes/station/stationCheckConf/getProductInfo/' + checkTemplateId,
    method: 'get'
  })
}

// 新增所属产品
export function addStationCheckConf(data) {
  return request({
    url: '/mes/station/stationCheckConf',
    method: 'post',
    data: data
  })
}

// 修改所属产品
export function updateStationCheckConf(data) {
  return request({
    url: '/mes/station/stationCheckConf',
    method: 'put',
    data: data
  })
}

// 删除所属产品
export function delStationCheckConf(id) {
  return request({
    url: '/mes/station/stationCheckConf/' + id,
    method: 'delete'
  })
}
